<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <script>
   function delayCallback(delay, callback) {

        setTimeout(() => {

            callback('延迟完成');

        }, delay);

   }
   /* function delayCallback(delay) {
        return new Promise((resolve) => {
            setTimeout(() => {
                resolve('延迟完成');
            }, delay);
        });
    }

    // 使用示例
    delayCallback(2000)
        .then((message) => {
            console.log(message);
        })
        .catch((error) => {
            console.error(error);
        });
 */
  
   </script>
</body>
</html>